﻿var module = (function () {
	var container = null;
	var module = null;
	function init(){
		container = $("form-container");
        module = $("sign-up");
		if (container){
            if (!$defined(window.FC)){
                container.hide();
            }
            initEvents();
        }
	}	
    function initEvents(){
    }
	$domready(init);
})();

function OnCancel(item){
   document.location.href = returnUrl;
}
function OnSubmit(item){
    WS.Save(
        lang
        ,returnUrl
        ,item.user_name 
        ,item.email
        ,function(response){
            this.hideMask();
            call_back.run(response, this);
        }.bind(this)
        ,function(e){
            this.hideMask();
            call_back.run("<span>" + e + "</span><a href='" + returnUrl + "' >Click to return</a>", this);
        }.bind(this));
}
function call_back(response){
   container.set("html", (response));
}
